deploy-job:      # This job runs in the deploy stage.
  stage: deploy  # It only runs when *both* jobs in the test stage complete successfully.
  only:
    - dev_deploy

  before_script:
    - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client git -y )'
    - eval $(ssh-agent -s)
    - echo "$SSH_PRIVATE_KEY_LOBSTER_STAGE" | tr -d '\r' | ssh-add -
    - mkdir -p ~/.ssh
    - chmod 700 ~/.ssh
    - ssh-keyscan -p 5588 95.216.10.123 >> ~/.ssh/known_hosts
    - chmod 644 ~/.ssh/known_hosts
  script:
    - ssh lobster_u@95.216.10.123 -p 5588 "cd ~/web/www/velovex.staging.lobsterlab.io/ && git reset --hard origin/dev_deploy && git fetch --all  | composer update | php artisan migrate"
